package com.zhuss.controller.team;

import com.zhuss.bean.bo.team.invest.CareInvestListBo;
import com.zhuss.bean.bo.team.invest.DetailInvestBo;
import com.zhuss.bean.bo.team.invest.SearchInvestBo;
import com.zhuss.common.AbstractBo;
import com.zhuss.common.BaseController;
import com.zhuss.common.ReadService;
import com.zhuss.exception.WpsException;
import com.zhuss.team.invest.InvestReadServiceExt;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: zhushanshuo
 * @Date: 2020/3/26 11:07
 */
@RestController
@RequestMapping("/invest")
public class InvestReadController extends BaseController {

    @Autowired
    @Qualifier("investReadService")
    private ReadService<Object, Object> investReadService;

    @Autowired
    @Qualifier("investReadServiceExt")
    private InvestReadServiceExt investReadServiceExt;

    /**
     * 列表
     * @throws WpsException
     */
    @ResponseBody
    @RequestMapping("/list")
    public Object list(@RequestBody SearchInvestBo bo) throws WpsException {
        Object result = investReadService.list(bo);
        return result;
    }

    /**
     * 详情
     * @throws WpsException
     */
    @ResponseBody
    @RequestMapping("/detail")
    public Object detail(@RequestBody DetailInvestBo bo) throws WpsException {
        Object result = investReadService.detail(bo);
        return result;
    }

    /**
     * 获取问题列表
     * @param bo
     * @return
     * @throws WpsException
     */
    @ResponseBody
    @RequestMapping("/careInvestList")
    public Object careInvestList(@RequestBody CareInvestListBo bo) throws WpsException {
        Object result = investReadServiceExt.careInvestList(bo);
        return result;
    }

    /**
     * 获取问卷类型
     */
    @ResponseBody
    @RequestMapping("/getInvestGroupList")
    public Object getInvestGroup(@RequestBody AbstractBo bo) throws WpsException {
        return investReadServiceExt.getInvestGroup(bo);
    }

    /**
     * 获取问卷下拉框
     */
    @ResponseBody
    @RequestMapping("/getInvestList")
    public Object getInvestList(@RequestBody AbstractBo bo) throws WpsException {
        return investReadServiceExt.getInvestList(bo);
    }
}
